import request from '@/utils/request'

// 查询岗位列表
export function listApi(query) {
  return request({
    url: '/device/fence/data',
    method: 'get',
    params: query
  })
}

// 查询岗位详细
export function findByIdApi(postId) {
  return request({
    url: '/device/fence/' + postId,
    method: 'get'
  })
}

// 新增岗位
export function addApi(data) {
  return request({
    url: '/device/fence',
    method: 'post',
    data: data
  })
}

// 修改岗位
export function updateApi(data) {
  return request({
    url: '/device/fence',
    method: 'put',
    data: data
  })
}

// 删除岗位
export function deleteApi(postId) {
  return request({
    url: '/device/fence/' + postId,
    method: 'delete'
  })
}

// 修改岗位
export function disableApi(id) {
  return request({
    url: '/device/fence/status/'+id,
    method: 'get',
  })
}
//发送指令
export function sendInstructionsApi(data) {
  return request({
    url: '/device/fence/send',
    method: 'post',
    data: data
  })
}